<form action="{:url()}" method="post" class="form_single">
    <div class="box">
      <div class="box-body">
        <div class="row">
          <div class="col-md-6">
            <div class="form-group">
              <label>等级名称</label>
              <span>（VIP等级的名称）</span>
              <input class="form-control" name="name" placeholder="请输入等级名称" value="{$info['name']|default=''}" type="text">
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group">
              <label>等级图标</label>
              <span>（VIP等级的图标）</span>
              <br/>
              {assign name="icon_id" value="$info.icon|default='0'" /}
              {:widget('file/index', ['name' => 'icon', 'value' => $icon_id, 'type' => 'img'])}
            </div>
          </div>
 
          <div class="col-md-6">
            <div class="form-group">
              <label>价格</label>
              <span>（VIP等级的价格）</span>
              <input class="form-control" name="price" placeholder="请输入价格" value="{$info['price']|default=''}" type="number" step="0.01">
            </div>
          </div>
 
          <div class="col-md-6">
            <div class="form-group">
              <label>有效期</label>
              <span>（VIP有效天数）</span>
              <input class="form-control" name="duration" placeholder="请输入有效天数" value="{$info['duration']|default=30}" type="number">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>排序</label>
              <span>（数字越小越靠前）</span>
              <input class="form-control" name="sort" placeholder="请输入排序" value="{$info['sort']|default=100}" type="number">
            </div>
          </div>

          <div class="col-md-6">
            <div class="form-group">
              <label>状态</label>
              <span>（VIP等级状态）</span>
              <select class="form-control" name="status">
                <option value="1" {if condition="($info.status ?? 1) == 1"}selected{/if}>启用</option>
                <option value="0" {if condition="($info.status ?? 1) == 0"}selected{/if}>禁用</option>
              </select>
            </div>
          </div>

          <!-- <div class="col-md-12">
            <div class="form-group">
              <label>权益描述</label>
              <span>（VIP等级的权益说明）</span>
              <textarea class="form-control" name="description" rows="4" placeholder="请输入权益描述">{$info['description']|default=''}</textarea>
            </div>
          </div>

          <div class="col-md-12">
            <div class="form-group">
              <label>详细说明</label>
              <span>（VIP等级的详细说明）</span>
              <textarea class="form-control" name="content" rows="6" placeholder="请输入详细说明">{$info['content']|default=''}</textarea>
            </div>
          </div> -->
            
        </div>
      </div>
      <div class="box-footer">
        
        <input type="hidden" name="id" value="{$info['id']|default='0'}"/>
          
        {include file="layout/edit_btn_group"/}
        
      </div>
    </div>
</form>

<script>
$(function() {
    // 设置下拉菜单默认值
    ob.setValue("status", {$info.status ?? 1});
});
</script>